<?php

/**
    * Vypíše odkaz.
    * @param string $href<p>
    * Kam odkazovat.
    * </p>  
    * @param string $title<p>
    * Popis odkazu.
    * </p>
    * @return string
*/
function html_href($href, $title)
{
    global $base;
    
    return '<a href="'.$base.$href.'">'.$title.'</a>';
    
}

/**
 * Vypíše HTML chybovou hlášku.
 * @param string $text <p>
 * Text hlášky. 
 * </p>
 * @return string
 */
function html_error($text) 
{
    $vrat = "<center><div style='text-align:left; width: 634px; _width: 673px; border:1px solid #BC2F36; background:rgba(206, 76, 76, 0.3); font-size:13pt; -webkit-box-shadow:0px 0px 10px black; -moz-box-shadow:0px 0px 10px #000; margin-bottom: 20px;'>";
    $vrat .= "<div style='padding: 10px;'>" . $text . "</div>";
    $vrat .= "</div></center>";  
    return $vrat;
}

/**
 * Vypíše HTML hlášku o provedení.
 * @param string $text <p>
 * Text hlášky. 
 * </p>
 * @return string
 */
function html_done($text) 
{
    $vrat = "<center><div style='text-align:left; width: 634px; _width: 673px; border:1px solid #259433; background:rgba(78, 141, 66, 0.3); font-size:13pt; -webkit-box-shadow:0px 0px 10px black; -moz-box-shadow:0px 0px 10px #000; margin-bottom: 20px;'>";
    $vrat .= "<div style='padding: 10px;'>" . $text . "</div>";
    $vrat .= "</div></center>";  
    return $vrat;
}

/**
 * Vypíše HTML hlášku s informací.
 * @param string $text <p>
 * Text hlášky. 
 * </p>
 * @return string
 */
function html_info($text) 
{
    $vrat = "<center><div style='text-align:left; width: 634px; _width: 673px; border:1px solid #72217D; background:rgba(145, 52, 153, 0.29); font-size:13pt; -webkit-box-shadow:0px 0px 10px black; -moz-box-shadow:0px 0px 10px #000; margin-bottom: 20px;'>";
    $vrat .= "<div style='padding: 10px;'>" . $text . "</div>";
    $vrat .= "</div></center>";  
    return $vrat;
}

function html_image($src, $title)
{
    global $base;
    
    return '<img src="'.$base.$src.'" title="'.$title.'" alt="'.$title.'">';
}

function html_item($src, $id, $uid, $class, $style, $number = 1, $equiped = false, $urlplus = "")
{
    global $base;
    
    $style .= " background: url('".$base.$urlplus."images/items/".$src."'); width: 60px; height: 60px; position: relative; float: left;";
    $count = "";
    
    if ($number > 1)
    {
        $count = '<div style="color: white; position:absolute; top:35px; left:5px;"><b>'.$number.'</b></div>';
    }
    
    if ($equiped)
    {
        $count = '<div style="background: url(\''.$base.$urlplus.'images/icons/equiped.png\'); width: 18px; height: 17px; position:absolute; top: 37px; left: 4px;"></div>';
    }   
        
    return '<div '.($uid != "" ? 'id="item_'.$uid.'" rel="'.$base.$urlplus.'ajax/tooltip-item.php?id='.$id.'"' : '').($class != "" ? ' class="'.$class.' item" ' : ' class="item" ').($style != "" ? ' style="'.$style.'" ' : '').'/>'.$count.'</div>';
}